<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script src="__STATIC__/index/js/global/jquery-3.2.1.min.js"></script>
</head>
<body>
    <form action="javascript:;" method="post">
        <input type="text" name="auth_code" value="" onchange="check_form()">
    </form>
</body>
</html>
<script>
  function check_form(){
      var auth_code = $('input[name=auth_code]').val();
      $.post("{:url('Alipay/pay')}",
          {auth_code:auth_code},
          function(data){
              if(data.code == 1){

              }else{

              }
          }
      );
  }
</script>